mod manager;
pub mod config;
pub mod service;

use abi::{error::Error, reservation::*};
use async_trait::async_trait;
use sqlx::PgPool;

#[async_trait]
pub trait Rsvp {
    async fn reserve(&self, reservation: Reservation) -> Result<Reservation, Error>;
    async fn confirm(&self, id: ReservationId) -> Result<Reservation, Error>;
    async fn update_note(
        &self,
        id: ReservationId,
        note: String,
    ) -> Result<Reservation, Error>;
    async fn delete(&self, id: ReservationId) -> Result<(), Error>;
    async fn query(&self, id: QueryRequest) -> Result<Vec<Reservation>, Error>;
    async fn listen(&self, request: ListenRequest)
    -> Result<Vec<ListenResponse>, Error>;
}

pub struct ReservationManager {
    pool: PgPool,    
}
